package com.suntop.carousel.qlmediaplay.tools;

import com.suntop.carousel.qlmediaplay.animation.AccordionTransformer;
import com.suntop.carousel.qlmediaplay.animation.BackgroundToForegroundTransformer;
import com.suntop.carousel.qlmediaplay.animation.CubeInTransformer;
import com.suntop.carousel.qlmediaplay.animation.CubeOutTransformer;
import com.suntop.carousel.qlmediaplay.animation.DefaultTransformer;
import com.suntop.carousel.qlmediaplay.animation.DepthPageTransformer;
import com.suntop.carousel.qlmediaplay.animation.FlipHorizontalTransformer;
import com.suntop.carousel.qlmediaplay.animation.FlipVerticalTransformer;
import com.suntop.carousel.qlmediaplay.animation.ForegroundToBackgroundTransformer;
import com.suntop.carousel.qlmediaplay.animation.RotateDownTransformer;
import com.suntop.carousel.qlmediaplay.animation.RotateUpTransformer;
import com.suntop.carousel.qlmediaplay.animation.ScaleInOutTransformer;
import com.suntop.carousel.qlmediaplay.animation.StackTransformer;
import com.suntop.carousel.qlmediaplay.animation.TabletTransformer;
import com.suntop.carousel.qlmediaplay.animation.ZoomInTransformer;
import com.suntop.carousel.qlmediaplay.animation.ZoomOutSlideTransformer;
import com.suntop.carousel.qlmediaplay.animation.ZoomOutTranformer;

import androidx.viewpager2.widget.ViewPager2;

public class AnimationTools {
    private AnimationTools(){}
   private static AnimationTools inStance;

    public static AnimationTools getInStance() {
        if (inStance==null){
            inStance=new AnimationTools();
        }
        return inStance;
    }

    public ViewPager2.PageTransformer takeAnimationTransformer(Integer i) {
        ViewPager2.PageTransformer transformer=null;
        switch (i) {
            case 1:
                transformer=new DefaultTransformer();
                break;
            case 2:
                transformer=new AccordionTransformer();
                break;
            case 3:
                transformer=new BackgroundToForegroundTransformer();
                break;
            case 4:
                transformer=new CubeInTransformer();
                break;
            case 5:
                transformer=new CubeOutTransformer();
                break;
            case 6:
                transformer=new DepthPageTransformer();
                break;
            case 7:
                transformer=new FlipHorizontalTransformer();
                break;
            case 8:
                transformer=new FlipVerticalTransformer();
                break;
            case 9:
                transformer=new ForegroundToBackgroundTransformer();
                break;
            case 10:
                transformer=new RotateDownTransformer();
                break;
            case 11:
                transformer=new RotateUpTransformer();
                break;
            case 12:
                transformer=new ScaleInOutTransformer();
                break;
            case 13:
                transformer=new StackTransformer();
                break;
            case 14:
                transformer=new TabletTransformer();
                break;
            case 15:
                transformer=new ZoomInTransformer();
                break;
            case 16:
                transformer=new ZoomOutSlideTransformer();
                break;
            case 17:
                transformer=new ZoomOutTranformer();
                break;
        }
        return transformer;
    }
}
